#!/bin/bash

# 定义变量
INSTALL_DIR="/opt/sshpass"

# 配置编译选项
echo "正在配置编译选项..."
./configure --prefix=${INSTALL_DIR}

# 编译源码
echo "正在编译源码..."
make -j$(nproc)

# 安装 sshpass
echo "正在安装 sshpass 到 ${INSTALL_DIR}..."
make install

# 验证安装
echo "验证安装结果..."
${INSTALL_DIR}/bin/sshpass -V

echo "sshpass 编译安装完成！"


